package entity.table;

import com.google.common.base.CaseFormat;
import constant.table.ClazzConstact;

import java.io.Serializable;

public class TableDto implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 字段名称 Java
     */
    private String columnName;

    /**
     * 字段名称 Sql
     */
    private String columnNameSql;

    /**
     * 字段类型 Java
     */
    private String dataType;

    /**
     * Mapper jdbcType
     */
    private String jdbcType;

    /**
     * 字段类型 Sql
     */
    private String dataTypeSql;

    /**
     * 字段备注
     */
    private String columnComment;

    /**
     * 表名
     */
    private String tableName;

    /**
     * 主键标记
     */
    private String columnKey;

    public TableDto() {
        super();
    }

    public TableDto(String columnName, String dataType, String columnComment) {
        this.columnName = columnName;
        this.dataType = dataType;
        this.columnComment = columnComment;
    }

    public TableDto(String columnName, String columnNameSql, String dataType, String jdbcType, String dataTypeSql, String columnComment, String tableName, String columnKey) {
        this.columnName = columnName;
        this.columnNameSql = columnNameSql;
        this.dataType = dataType;
        this.jdbcType = jdbcType;
        this.dataTypeSql = dataTypeSql;
        this.columnComment = columnComment;
        this.tableName = tableName;
        this.columnKey = columnKey;
    }

    public String getColumnName() {
        return columnName;
    }

    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }

    public String getDataType() {
        return dataType;
    }

    public void setDataType(String dataType) {
        this.dataType = dataType;
    }

    public String getColumnComment() {
        return columnComment;
    }

    public void setColumnComment(String columnComment) {
        this.columnComment = columnComment;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getColumnKey() {
        return columnKey;
    }

    public void setColumnKey(String columnKey) {
        this.columnKey = columnKey;
    }

    public String getDataTypeSql() {
        return dataTypeSql;
    }

    public void setDataTypeSql(String dataTypeSql) {
        this.dataTypeSql = dataTypeSql;
    }

    public String getColumnNameSql() {
        return columnNameSql;
    }

    public void setColumnNameSql(String columnNameSql) {
        this.columnNameSql = columnNameSql;
    }

    public String getJdbcType() {
        return jdbcType;
    }

    public void setJdbcType(String jdbcType) {
        this.jdbcType = jdbcType;
    }
// =================================================================================================================
    /*public String getLowerCamel() {
        return CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, columnName);
    }*/

    /*public String getSetterName() {
        return ClazzConstact.SET + CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, columnName);
    }

    public String getGetterName() {
        return ClazzConstact.GET + CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, columnName);
    }*/

    public String getTableNameCamel() {
        return CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, tableName);
    }

    //        System.out.println(CaseFormat.LOWER_HYPHEN.to(CaseFormat.LOWER_CAMEL, "test-data")); // testData
    //        System.out.println(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "test_data")); // testData
    //        System.out.println(CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, "test_data")); // TestData


    //        System.out.println(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, "testdata")); // testdata
    //        System.out.println(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, "TestData")); // test_data
    //        System.out.println(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_HYPHEN, "testData")); // test-data


    //    <dependency>
    //        <groupId>com.google.guava</groupId>
    //        <artifactId>guava</artifactId>
    //        <version>21.0</version>
    //    </dependency>
}
